package com.shenghua.utils.beans;

/**
 * 错误码
 * Created by YoungRemus on 2018/8/28.
 */
public enum ErrorCode {
    SUCCESS(200, "操作成功"),
    FAILURE(400, "操作失败"),
    ERROR(500, "操作异常"),
    AUTH_NO_LIMIT(100,"没有权限"),
    AUTH_AUTHENTICATION_FAILED(101,"用户验证失败"),
    AUTH_AUTHENTICATION_ERROR(102,"用户认证过程出错"),
    AUTH_ILLEGAL_USERCODE(103,"用户账号非法"),
    AUTH_PARAMETER_ERROR(104,"验证参数错误"),
    AUTH_TOKEN_INVALID(105,"token令牌无效"),
    AUTH_UNKNOWN_ERROR(106,"未知的错误"),
    AUTH_USER_ALREADY_EXISTS(107,"用户已经存在"),
    AUTH_TOKEN_DELETE_ERROR(108,"token删除失败"),
    AUTH_VERIFYCODE_ERROR(109,"验证码有误"),
    AUTH_RANDOMPASSWORD_ERROR(110,"随机密码有误"),
    // 用户
    AUTH_USER_REGISTER_FAILED(111,"用户注册失败"),
    AUTH_USER_MSG_NULL(112,"注册信息填写不完整"),
    AUTH_USER_REGISTER_SUCCESS(113,"用户注册成功！"),
    AUTH_USERNAME_USABLE(115,"账号未被占用！"),
    USER_QUERY_IS_NULL(116,"用户查询信息为空"),
    USER_NOT_EXISTS(118,"用户不存在"),
    PAGE_IS_NULL(199,"分页信息为空"),
    USER_EDIT_SUCCESS(120,"用户修改成功"),
    USER_EDIT_FAIL(121,"用户修改失败"),
    USER_Query_SUCCESS(117,"用户查询成功"),
    // 公告
    NOTICE_QUERY_SUCCESS(131,"公告查询成功"),
    NOTICE_IS_NULL(132,"公告参数信息为空"),
    NOTICENO_IS_NULL(133,"公告编号不能为空"),
    NOTICE_ADD_FAIL(134,"公告信息添加失败"),
    NOTICE_ADD_SUCCESS(135,"公告添加成功"),
    NOTICENO_EXISTS(136,"公告编号已经存在"),
    NOTICE_NOT_EXISTS(137,"公告不存在"),
    NOTICE_DELETE_SUCCESS(139,"公告删除成功"),
    NOTICE_DELETE_FAIL(140,"公告删除失败"),
    NOTICE_PIC_NOT_EXISTS(141,"公告图片不存在"),
    NOTICE_DELETE_PIC_FAIL(142,"公告图片删除失败"),
    NOTICE_CHANGEDISPLAY_SUCCESS(143,"公告设置显示或者取消显示成功"),
    NOTICE_CHANGEDISPLAY_FAIL(144,"公告设置显示或者取消显示失败"),
    NOTICE_LOAD_SUCCESS(145,"公告加载成功"),
    NOTICE_LOAD_FAIL(146,"公告加载失败"),
    // 登录
    LOGIN_SUCCESS(210,"登录成功"),
    LOGINNAME_NOT_EXISTS(201,"用户名不存在"),
    LOGINNAME_OR_PWD_MISTAKE(202,"账号或密码不正确"),
    USER_STOPED(203,"账号已停用"),
    USER_FORBIDDEN(204,"账号已禁用"),
    USER_FROZEN(205,"账号已冻结"),
    USER_UNKNOW_STATUS(206,"账号状态未知"),
    USER_SUPER_ADMIN_EDIT_FAIL(207,"只允许一个超级管理员用户存在"),
    LOGIN_REPEAT(208,"账号已经登录"),
    LOGIN_LOCK_FAIL(209,"账号加锁失败"),
    // 模具
    MOULD_ADD_SUCCESS(300,"模具添加成功"),
    MOULD_IS_NULL(301,"模具参数信息为空"),
    MOULD_Query_SUCCESS(302,"模具查询成功"),
    MOULDNO_IS_NULL(303,"模具编号不能为空"),
    MOULD_NOT_EXISTS(306,"模具不存在"),
    MOULDNO_EXISTS(305,"模具编号已经存在"),
    MOULD_ADD_FAIL(304,"模具信息添加失败"),
    MOULD_DELETE_FAIL(307,"模具删除失败"),
    MOULD_DELETE_SUCCESS(308,"模具删除成功"),
    MOULD_EDIT_FAIL(309,"模具编辑失败"),
    MOULD_EDIT_SUCCESS(310,"模具编辑成功"),
    MOULD_SELECT_SUCCESS(311,"模具查询成功"),
    MOULD_DELETE_PIC_FAIL(312,"模具图片删除失败"),
    MOULD_EDIT_PIC_SUCCESS(313,"模具图片编辑失败"),
    MOULD_PIC_NOT_EXISTS(314,"模具图片不存在"),

    USER_EXIT_SYSTEM(403,"成功退出系统！"),
    USER_NOT_LOGIN(401,"用户未登录"),
    PARAMETER_IS_NULL(402,"参数为空"),
    //文件上传
    FILE_UPLOAD_ERROR(509,"文件上传过程出错"),
    FILE_UPLOAD_SUCCESS(501,"文件上传成功"),
    FILE_UPLOAD_FIAL(502,"文件上传失败"),
    FILE_EXTENSION_ERROR(503,"文件格式不正确"),
    TEMPFILE_UPLOAD_FIAL(504,"临时文件上传失败"),
    TEMPFILE_UPLOAD_SUCCESS(505,"临时文件上传成功"),
    TEMPFILE_DELETE_FIAL(506,"临时文件删除失败"),
    TEMPFILE_DELETE_SUCCESS(507,"临时文件删除成功"),
    TEMPFILE_NOT_EXISTS(508,"临时文件不存在"),
    //权限
    LIMITS_ADD_SUCCESS(600,"权限添加成功"),
    LIMITS_ADD_FAIL(601,"权限添加失败"),
    LIMITS_EDIT_SUCCESS(602,"权限编辑成功"),
    LIMITS_EDIT_FAIL(603,"权限编辑失败"),
    LIMITS_DELETE_FAIL(604,"权限删除失败"),
    LIMITS_DELETE_SUCCESS(605,"权限删除成功"),
    LIMITS_NOT_ALLOW_DELETE(606,"父级权限不允许删除"),
    LIMITS_ALLOW_DELETE(607,"权限允许删除"),
    LIMITS_Query_SUCCESS(610,"权限查询成功"),
    LIMITS_Query_FAIL(611,"权限查询失败"),
    ROLELIMIT_QUERY_SUCCESS(612,"角色权限查询成功"),
    ROLELIMIT_QUERY_FAIL(613,"角色权限查询失败"),
    //角色
    ROLES_ADD_SUCCESS(700,"角色添加成功"),
    ROLES_ADD_FAIL(701,"角色添加失败"),
    ROLES_EDIT_SUCCESS(702,"角色编辑成功"),
    ROLES_EDIT_FAIL(703,"角色编辑失败"),
    ROLES_DELETE_FAIL(704,"角色删除失败"),
    ROLES_DELETE_SUCCESS(705,"角色删除成功"),
    ROLES_NOT_ALLOW_DELETE(706,"管理员角色不允许删除"),
    ROLES_ALLOW_DELETE(707,"角色允许删除"),
    ROLES_LIMIT_SAVE_FAIL(708,"角色权限信息保存失败"),
    ROLES_LIMIT_SAVE_SUCCESS(709,"角色权限信息保存成功"),
    ROLES_Query_SUCCESS(710,"角色查询成功"),
    ROLES_Query_FAIL(711,"角色查询失败"),
    ROLES_SUPER_ADMIN_ADD_FAIL(712,"超级管理员添加失败");
    private int key;
    private String value;

    ErrorCode(){}

    ErrorCode(int key,String value){
        this.key = key;
        this.value = value;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
